<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\PasswordForm */
/* @var $form ActiveForm */

$this->title = "修改密码";
$this->params['breadcrumbs'][] = ['label' => '首页', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-password">
    <?php if (Yii::$app->session->hasFlash('success')): ?>
        <div class="alert alert-success alert-dismissable">
            <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
            <?= Yii::$app->session->getFlash('success') ?>
        </div>
    <?php endif; ?>
    <?php if (Yii::$app->session->hasFlash('error')): ?>
        <div class="alert alert-danger alert-dismissable">
            <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
            <?= Yii::$app->session->getFlash('error') ?>
        </div>
    <?php endif; ?>

    <?php $form = ActiveForm::begin([
        'options'=>['enctype'=>'multipart/form-data','class' => 'form-horizontal'],
        'fieldConfig' => [
            'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-3\">{error}</div>",
            'labelOptions' => ['class' => 'col-lg-2 control-label'],
        ],
    ]); ?>
        <?= $form->field($model, 'oldPassword')->passwordInput()->label('旧密码') ?>
        <?= $form->field($model, 'password')->passwordInput()->label('新密码') ?>
        <?= $form->field($model, 'rePassword')->passwordInput()->label('重复密码') ?>
    <div class="form-group">
            <div class="col-lg-2 control-label">
                <?= Html::submitButton('提交', ['class' => 'btn btn-primary']) ?>
            </div>
            <div class="col-lg-5"></div>
            <div class="col-lg-3"></div>

    </div>
    <?php ActiveForm::end(); ?>

</div>